package a.g;

import a.c.d;
import a.c.e;
import a.c.k;
import a.c.m;
import a.c.n;
import a.c.w;
import a.f.l.b;
import a.f.l.r;
import a.h.*;
import a.h.z;
import a.i.db;
import a.i.p;
import a.j.g;

import java.awt.*;
import java.util.HashSet;
import java.util.Set;

import a.g.h;
import a.j.g;
import a.f.l.r;
import a.i.p;
import a.f.l.b;

public class i
  extends h
{
  private static final String q = "BUS_ROUTER";
  private static final String r = "GROUP_LAYOUT";
  private static final String s = "GROUP_SELECTION";
  private static final String t = "GROUP_ROUTING";
  private static final String u = "ALL";
  private static final String v = "BUSES";
  private static final String w = "COLOR";
  private static final String x = "CROSSING_COST";
  private static final String y = "CROSSING_REROUTING";
  private static final String z = "GRID_ENABLED";
  private static final String A = "GRID_SPACING";
  private static final String B = "MINIMUM_CONNECTIONS_COUNT";
  private static final String C = "MINIMUM_BACKBONE_LENGTH";
  private static final String D = "MIN_DISTANCE_TO_EDGES";
  private static final String E = "MIN_DISTANCE_TO_NODES";
  private static final String F = "PREFERRED_BACKBONE_COUNT";
  private static final String G = "PARTIAL";
  private static final String H = "SCOPE";
  private static final String I = "SINGLE";
  private static final String J = "SUBSET";
  private static final String K = "SUBSET_BUS";
  private final b L = new b();
  protected boolean M = true;
  protected boolean N = true;
  protected boolean O = true;
  public static int P;
  
  public i()
  {
    super("BUS_ROUTER", "yFiles Layout Team", "Routes edges in bus-style");
  }
  
  protected dc j()
  {
    dc localdc = new dc("BUS_ROUTER");
    b(localdc);
    return localdc;
  }
  
  protected void b(dc paramdc)
  {
    int i = f.p;
    z localz = new z(paramdc);
    b localb = new b();
    ec localec;
    cc localcc;
    if (i == 0) {
      if (this.M)
      {
        paramdc.a("SCOPE", new String[] { "ALL", "SUBSET", "SUBSET_BUS", "PARTIAL" }, localb.o());
        paramdc.a("BUSES", new String[] { "SINGLE", "COLOR" }, 0);
        paramdc.a("GRID_ENABLED", localb.e());
        localec = paramdc.a("GRID_SPACING", localb.d());
        localec.a(nc.y, new Integer(1));
        localec = paramdc.a("MIN_DISTANCE_TO_NODES", localb.f());
        localec.a(nc.y, new Integer(1));
        localec = paramdc.a("MIN_DISTANCE_TO_EDGES", localb.g());
        localec.a(nc.y, new Integer(1));
        localz.a("GRID_ENABLED", Boolean.TRUE, "GRID_SPACING");
        localcc = new cc();
        localcc.a("OptionGroup.title", "GROUP_LAYOUT");
        localcc.a(paramdc.k("SCOPE"));
        localcc.a(paramdc.k("BUSES"));
        localcc.a(paramdc.k("GRID_ENABLED"));
        localcc.a(paramdc.k("GRID_SPACING"));
        localcc.a(paramdc.k("MIN_DISTANCE_TO_NODES"));
        localcc.a(paramdc.k("MIN_DISTANCE_TO_EDGES"));
      }
    }
    if (i == 0)
    {
      if (this.N)
      {
        localec = paramdc.a("PREFERRED_BACKBONE_COUNT", localb.j());
        localec.a(nc.y, new Integer(1));
        localec = paramdc.a("MINIMUM_BACKBONE_LENGTH", localb.k());
        localec.a(jc.y, new Double(1.0D));
        localcc = new cc();
        localcc.a("OptionGroup.title", "GROUP_SELECTION");
        localcc.a(paramdc.k("PREFERRED_BACKBONE_COUNT"));
        localcc.a(paramdc.k("MINIMUM_BACKBONE_LENGTH"));
      }
      if (i != 0) {}
    }
    else if (this.O)
    {
      localec = paramdc.a("CROSSING_COST", localb.h());
      localec.a(jc.y, new Double(0.0D));
      paramdc.a("CROSSING_REROUTING", localb.i());
      localec.a(jc.y, new Double(0.0D));
      localec = paramdc.a("MINIMUM_CONNECTIONS_COUNT", localb.l());
      localec.a(nc.y, new Integer(1));
      localcc = new cc();
      localcc.a("OptionGroup.title", "GROUP_ROUTING");
      localcc.a(paramdc.k("CROSSING_COST"));
      localcc.a(paramdc.k("CROSSING_REROUTING"));
      localcc.a(paramdc.k("MINIMUM_CONNECTIONS_COUNT"));
    }
    a(paramdc, this.L);
  }
  
  protected void a(dc paramdc, b paramb)
  {
    int i = f.p;
    if (i == 0) {
      if (this.M)
      {
        paramdc.b("SCOPE", a(paramb.o()));
        paramdc.b("GRID_ENABLED", Boolean.valueOf(paramb.e()));
        paramdc.b("GRID_SPACING", new Integer(paramb.d()));
        paramdc.b("MIN_DISTANCE_TO_NODES", new Integer(paramb.f()));
        paramdc.b("MIN_DISTANCE_TO_EDGES", new Integer(paramb.g()));
      }
    }
    if (i == 0) {
      if (this.N)
      {
        paramdc.b("CROSSING_COST", new Double(paramb.h()));
        paramdc.b("CROSSING_REROUTING", Boolean.valueOf(paramb.i()));
      }
    }
    if (this.O)
    {
      paramdc.b("PREFERRED_BACKBONE_COUNT", new Integer(paramb.j()));
      paramdc.b("MINIMUM_CONNECTIONS_COUNT", new Integer(paramb.l()));
      paramdc.b("MINIMUM_BACKBONE_LENGTH", new Double(paramb.k()));
    }
  }
  
  public void a(b paramb)
  {
    int i = f.p;
    dc localdc = i();
    if (i == 0) {
      if (this.M)
      {
        paramb.a(a(localdc.j("SCOPE")));
        paramb.a(localdc.g("GRID_ENABLED"));
        paramb.a(localdc.e("GRID_SPACING"));
        paramb.b(localdc.e("MIN_DISTANCE_TO_NODES"));
        paramb.c(localdc.e("MIN_DISTANCE_TO_EDGES"));
      }
    }
    if (i == 0) {
      if (this.N)
      {
        paramb.a(localdc.f("CROSSING_COST"));
        paramb.b(localdc.g("CROSSING_REROUTING"));
      }
    }
    if (this.O)
    {
      paramb.d(localdc.e("PREFERRED_BACKBONE_COUNT"));
      paramb.e(localdc.e("MINIMUM_CONNECTIONS_COUNT"));
      paramb.b(localdc.f("MINIMUM_BACKBONE_LENGTH"));
    }
  }
  
  protected b z()
  {
    return this.L;
  }
  
  protected void n()
  {
    a(this.L);
  }
  
  protected void m()
  {
    int i = f.p;
    boolean bool4 = f.o;
    super.m();
    a(this.L);
    if (i == 0) {
      if (!this.M) {
        return;
      }
    }
    g localg = e();
    dc localdc = i();
    boolean bool1 = "COLOR".equals(localdc.j("BUSES"));
    boolean bool2 = "PARTIAL".equals(localdc.j("SCOPE"));
    n localn = db.b();
    if (i == 0) {
      localg.a(b.j, localn);
    }
    Object localObject1 = "SUBSET".equals(localdc.j("SCOPE")) ? localg.S() : localg.w();
    Object localObject2;
    Object localObject4;
    do
    {
      if (!((m)localObject1).e()) {
        break;
      }
      localObject2 = ((m)localObject1).a();
      if (((i != 0) || (bool2)) && ((i != 0) || (!localg.y(((d)localObject2).e())))) {
        if (i != 0) {}
      }
      boolean bool3 = !localg.y(((d)localObject2).f());
      localObject4 = bool1 ? localg.t((d)localObject2).A() : Color.BLACK;
      localn.a(localObject2, new r(localObject4, bool3));
      ((m)localObject1).f();
    } while (!bool4);
    localObject1 = localg.c(b.j);
    if (i == 0) {
      if ("SUBSET".equals(localdc.j("SCOPE")))
      {
        localg.a(this.L.n(), new p()
        {
          private final g val$graph;
          
          public boolean getBool(Object paramAnonymousObject)
          {
            int i = f.p;
            if ((i != 0) || ((paramAnonymousObject instanceof d))) {
              if (i != 0) {}
            }
            return this.val$graph.v((d)paramAnonymousObject);
          }
        });
        if ((i == 0) && (!bool4)) {
          return;
        }
      }
    }
    Object localObject3;
    if (i == 0) {
      if ("SUBSET_BUS".equals(localdc.j("SCOPE")))
      {
        localObject2 = new HashSet();
        localObject3 = localg.S();
        do
        {
          if (!((m)localObject3).e()) {
            break;
          }
          ((Set)localObject2).add(((r)((k)localObject1).get(((m)localObject3).a())).a());
          ((m)localObject3).f();
          if (i != 0) {
            break label421;
          }
          if (bool4) {
            break label419;
          }
        } while (!bool4);
        if (i != 0) {
          break label453;
        }
        localg.a(this.L.n(), new p()
        {
          private final Set val$selectedIDs;
          private final k val$descriptorDP;
          
          public boolean getBool(Object paramAnonymousObject)
          {
            return this.val$selectedIDs.contains(((r)this.val$descriptorDP.get(paramAnonymousObject)).a());
          }
        });
      }
    }
    label419:
    label421:
    if ((i != 0) || ((bool4) && ("PARTIAL".equals(localdc.j("SCOPE")))))
    {
      localObject2 = new HashSet();
      label453:
      localObject3 = localg.R();
      label561:
      label563:
      do
      {
        do
        {
          if (!((w)localObject3).e()) {
            break label566;
          }
          localObject4 = ((w)localObject3).d();
          if (bool4) {
            return;
          }
          m localm = ((e)localObject4).l();
          do
          {
            if (!localm.e()) {
              break;
            }
            ((Set)localObject2).add(((r)((k)localObject1).get(localm.a())).a());
            localm.f();
            if (i != 0) {
              break label563;
            }
            if (bool4) {
              break label561;
            }
          } while (!bool4);
        } while (i != 0);
        ((w)localObject3).f();
      } while (!bool4);
      label566:
      if (i == 0) {
        localg.a(this.L.n(), new p()
        {
          private final Set val$selectedIDs;
          private final k val$descriptorDP;
          
          public boolean getBool(Object paramAnonymousObject)
          {
            return this.val$selectedIDs.contains(((r)this.val$descriptorDP.get(paramAnonymousObject)).a());
          }
        });
      }
    }
  }
  
  protected void o()
  {
    int i = f.p;
    if (i == 0) {
      if (this.M)
      {
        e().j(b.j);
        if (i != 0) {
          return;
        }
        if (!"ALL".equals(i().j("SCOPE"))) {
          e().j(this.L.n());
        }
      }
    }
    super.o();
  }
  
  private static byte a(Object paramObject)
  {
    int i = f.p;
    if (i == 0) {
      if ("ALL".equals(paramObject)) {
        return 0;
      }
    }
    if (i == 0) {
      if (!"SUBSET".equals(paramObject))
      {
        if (i != 0) {
          break label59;
        }
        if (!"SUBSET_BUS".equals(paramObject))
        {
          if (i != 0) {
            break label61;
          }
          if (!"PARTIAL".equals(paramObject)) {
            break label60;
          }
        }
      }
    }
    label59:
    return 1;
    label60:
    label61:
    return 0;
  }
  
  private static String a(byte paramByte)
  {
    if (f.p == 0) {
      if (0 == paramByte) {
        return "ALL";
      }
    }
    if (1 == paramByte) {
      return "SUBSET";
    }
    throw new IllegalArgumentException("Unknown scope: " + paramByte);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.g.i

 * JD-Core Version:    0.7.0.1

 */